//
//  LogInManager.m
//  operativeSide-2.0
//
//  Created by 王春程 on 2016/12/14.
//  Copyright © 2016年 王春程. All rights reserved.
//

#import "LogInManager.h"
#import "CCDHttpBaseTool.h"
@implementation LogInManager
+ (instancetype)sharedManager {
    static LogInManager *sharedManager = nil;
    
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        sharedManager = [[LogInManager alloc] init];
    });
    return sharedManager;
}

//登录
- (void)logInWithUserName:(NSString *)userName withPassWord:(NSString *)passWord withIsRember:(BOOL)isRem compelet:(isSucess)isSucessBlock
{

    double delayInSeconds = 2.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        BOOL success = [userName isEqualToString:@"user"] && [passWord isEqualToString:@"password"];
        isSucessBlock(success);
    });
    
    
}

//修改密码
- (void)reCodePasswordWithPasswrod:(NSString *)password complete:(changeCodeIsSuccess)isSuccessBlock{
    double delayInSeconds = 2.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        BOOL success = YES;
        isSuccessBlock(success);
    });
}


//认证
- (void)verifyWithUsername:(NSString *)username
           withPhoneNumber:(NSString *)phoneNumber
             withWorkplace:(NSString *)workplace
        withWithWorknumber:(NSString *)worknumber
                  complete:(verifyIsSuccess)isSuccess {
    double delayInSeconds = 2.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        BOOL success = YES;
        isSuccess(success);
    });

}
@end
